import request from '@/utils/request'

// 查询考试记录列表
export function listEx_record(query) {
    return request({
        url: '/ex/ex_record/list',
        method: 'get',
        params: query
    })
}

// 查询考试记录列表
export function listEx_record_my(query) {
    return request({
        url: '/ex/ex_record/list-my',
        method: 'get',
        params: query
    })
}

// 根据考试查询已报名的用户
export function get_appoint_user_ids(examId) {
    return request({
        url: `/ex/ex_record/get-appoint-user-ids/${examId}`,
        method: 'get',
    })
}

export function get_appoint_exam_ids() {
    return request({
        url: '/ex/ex_record/get-appoint-exam-ids',
        method: 'get'
    })
}

// 查询考试记录详细
export function getEx_record(id) {
    return request({
        url: '/ex/ex_record/' + id,
        method: 'get'
    })
}

// 新增考试记录
export function addEx_record(data) {
    return request({
        url: '/ex/ex_record',
        method: 'post',
        data: data
    })
}

// 分配用户
export function allot_users(data) {
    return request({
        url: '/ex/ex_record/allot-users',
        method: 'post',
        data: data
    })
}

// 预约
export function appoint(data) {
    return request({
        url: '/ex/ex_record/appoint',
        method: 'post',
        data: data
    })
}

// 修改考试记录
export function updateEx_record(data) {
    return request({
        url: '/ex/ex_record',
        method: 'put',
        data: data
    })
}

export function submitExRecord(id,timer,data) {
    return request({
        url: `/ex/ex_record/submit/${id}/${timer}`,
        method: 'put',
        data: data
    })
}

// 删除考试记录
export function delEx_record(id) {
    return request({
        url: '/ex/ex_record/' + id,
        method: 'delete'
    })
}
